#pragma once
#include "GameUIWindow.h"
#include "MyRender.h"
extern CMyRender g_kRender;

class CIDButton : public CGameButton
{
public:
	CIDButton()
	{
		m_dwID = 0;
		m_dwCount = 1;
	}
	~CIDButton()
	{

	}

	void SetID(DWORD dwID)
	{
		m_dwID = dwID;
	}
	void SetCount(DWORD dwCount)
	{
		m_dwCount = dwCount;
	}

	void OnDraw()
	{
		g_kRender.DrawRect(m_iAbsX,m_iAbsY,m_iWidth,m_iHeight,0xFF000000);

		char acTemp[256] = {0};
		sprintf_s(acTemp,sizeof(acTemp),"ID = %d",m_dwID);
		g_kRender.DrawText(acTemp,m_iAbsX,m_iAbsY,0xFF00FF00);

		//sprintf_s(acTemp,sizeof(acTemp),"CreateTime = %d",atoi(m_kUserData.c_str()));
		//g_kRender.DrawText(acTemp,m_iAbsX,m_iAbsY + 18,0xFF00FFFF);
	}

private:
	DWORD m_dwID;
	DWORD m_dwCount;	
};

class CGameRollCardWnd : public CGameUIWindow
{
	struct IDInfo
	{
		int iID;
		int iCreateTime;
		IDInfo()
		{
			iID = 0;
			iCreateTime = 0;
		}
	};
public:
	CGameRollCardWnd(void);
	~CGameRollCardWnd(void);

	void OnCreate();
	void OnUpdate();
	void OnDraw();
	bool OnChildMsg(ChildMsg eMsgType,const string& rkChildName,const string& rkUserData /* = "" */);
	bool OnLeftBtnDown(int iX,int iY);
	bool OnRightBtnDown(int iX,int iY);

public:
	bool TestFunc(const string& rkData)
	{
		int iW = kImage.GetWidth();
		return m_aiID.empty();	
	}

protected:
	vector<IDInfo> m_aiID;
	DWORD m_dwNextTime;
	vector<CIDButton*> m_apkShowBtns;

	CMyImage kImage;
};
